package ru.averta.notes.dao.impl;

import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
import ru.averta.notes.dao.SiteDao;
import ru.averta.notes.domain.Site;
import ru.averta.notes.domain.Url;

@Repository 
public class SiteDaoImpl extends UserableDaoImpl<Site, Long> implements SiteDao {

    @Override public Site findSiteByUrl(Url url) {
        return (Site) createCriteria().add(Restrictions.eq("url", url)).uniqueResult();
    }

}
